
<template>
  <div class="demo">
    <h2>学生姓名: {{ studentName }}</h2>
    <h2>年龄: {{ age }}</h2>
    <button @click="showName">点我提示学生姓名</button>
  </div>
</template>

<script>
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Student",
  data() {
    return {
      studentName: "里斯",
      age: 18,
    };
  },
  methods: {
    showName() {
      alert(this.studentName);
    },
  },
};
</script>